Skip to main content
This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal

Notes/Domino 6 and 7 Forum

Notes/Domino 6 and 7 Forum


  

PreviousPrevious NextNext

Here is an archiving routine I use...
~Fred Xanjumimarakoi 28.Oct.03 08:46 PM a Web browser
Domino Designer 6.0.1 Windows NT


I use this to archive a document and its responses:

Sub ArchiveDocument(doc As NotesDocument, dbArch As NotesDatabase)

%REM
This routine will archive the document that is passed to this routine.
It will archive/move the document as well as any responses to the
archive database that is passed to this routine.
The only thing it does not do is remove the doc that is passed.
That should be done from where this routine is being called.
It does, however, remove the responses, if there are any.
%END REM

On Error Goto ProcessError

Dim s As NotesSession
Dim db As NotesDatabase
Dim dcResp As NotesDocumentCollection
Dim docArch As NotesDocument
Dim docResp As NotesDocument
Dim docArchResp As NotesDocument
Dim Message As String
Dim Continue As Variant
Dim y As Integer

Set s = New NotesSession
Set db = s.CurrentDatabase

'Let's copy the doc to the Archive...
Set docArch = dbArch.CreateDocument

'Now, lets' copy all the items...
Call doc.CopyAllItems(docArch, True)

'Now, let's save the Archived document...
Call docArch.Save(True, True)

'Now, let's get all the responses (if any) from the main document...
Set dcResp = doc.Responses
If dcResp Is Nothing Then
Else
y = 0
For y = 1 To dcResp.Count
If y = 1 Then
Set docResp = dcResp.GetFirstDocument
Else
Set docResp = dcResp.GetNextDocument(docResp)
End If
If docResp Is Nothing Then
Else
Set docArchResp = dbArch.CreateDocument
Call docResp.CopyAllItems(docArchResp, True)
Call docArchResp.MakeResponse(docArch)
Call docArchResp.Save(True, True)
End If
Next
'Let's remove all the responses...
Call dcResp.RemoveAll(True)
End If

Exit Sub
ProcessError:
Continue = False
Message = "Error (" & Cstr(Err) & "): " & Error$ & " on line " & Cstr(Erl) & " in ArchivingRoutines: ArchiveDocument."
Messagebox Message, 16, Error In Processing…”
Exit Sub
End Sub

I pass the document to be archived and the database to archive to. It works pretty well for me.

Sample call:
'Copy document to the archive DB...
Call ArchiveDocument(doc, dbArch)

HTH,
Dan




Deleting Orphans (~Ted Desveluche... 28.Oct.03)
. . Here is an archiving routine I use.... (~Fred Xanjumima... 28.Oct.03)
. . RE: Deleting Orphans (~Bella Asaresab... 28.Oct.03)
. . RE: Deleting Orphans (~Bill Frokimari... 28.Oct.03)


Document Options






  Document options
Print this pagePrint this page

Search this forum

Forum views and search


  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Category
Platform
Release
Advanced search

Member Tools


RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS